﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using Windows.UI.Xaml.Media.Imaging;

namespace eLuk.Entity
{
	[DataContract]
	public class MailAddress : eLukObject
	{
		public MailAddress()
		{
			this.DisplayName = string.Empty;
			this.Address = string.Empty;
			this.ProfilePicture = "Assets\\user.png";
		}

		public MailAddress( string displayName, string address )
		{
			Address = ( address ?? "" ).Trim( ' ', '\n', '\t' );
			DisplayName = ( displayName ?? "" ).Trim( ' ', '\n', '\t' );
		}

		[DataMember]
		public string DisplayName { get; set; }
		
		[DataMember]
		public string ProfilePicture { get; set; }

		[DataMember]
		public string Address { get; set; }

		[DataMember]
		public byte[] ProfilePictureRaw { get; set; }

		public override string ToString()
		{
			return string.IsNullOrEmpty( DisplayName ) ? Address : string.Format( "{0} <{1}>", DisplayName, Address );
		}

	}

	[CollectionDataContract]
	public class MailAddresses : List<MailAddress>
	{ 
		
	}

}
